package com.qf.face.controller;

import com.qf.dto.face.MatchDTO;
import com.qf.face.util.BaiDuUtil;
import com.qf.result.R;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 人脸的controller
 * @version v1.0.0
 * @Description:
 * @author: 姜红凯
 * @date: 2022.04.12
 * @since 1.0
 */
@RestController
@RequestMapping("qf/face")
public class FaceController {

    @Resource
    private BaiDuUtil baiDuUtil;

    @PostMapping("match")
    public R match(@RequestBody MatchDTO matchDTO){
        double sc=baiDuUtil.isOne(matchDTO.getFace1(),matchDTO.getFace2());
        return R.ok().setResult("score",sc);
    }
}
